{extend name="public/container"}
{block name="title"}推广中心{/block}
{block name="head_top"}
<style>
    body {
        padding-bottom: 1.2rem;
        background-color: #f2f2f2;
    }
</style>
{/block}
{block name="content"}
<div class="promotion" id="app">
    <div class="header">
        <div class="cont">
            <div class="text">
                可提现金额(元)
                <div class="money">{$userInfo.brokerage_price}</div>
                <a class="link" href="{:Url('spread_detail',['type'=>2])}">提现记录<span
                        class="iconfont iconxiangyou"></span></a>
            </div>
            <a class="btn" href="{:Url('spread/withdraw')}">提现</a>
        </div>
    </div>
    <div class="sheet">
        <div class="item">
            今日收益
            <div class="num">{$data.income}</div>
        </div>
        <div class="item">
            今日新增订单
            <div class="num">{$data.order_count}</div>
        </div>
        <div class="item">
            今日新增学员
            <div class="num">{$data.spread_count}</div>
        </div>
    </div>
    <div class="control">
        <a class="link" href="{:Url('special')}">
            <span class="name">专题推广</span>
            <span class="iconfont iconxiangyou"></span>
        </a>
        <a class="link" href="{:Url('my_promoter')}">
            <span class="name">我的推广</span>
            <span class="iconfont iconxiangyou"></span>
        </a>
        <a class="link" href="{:Url('commission')}">
            <span class="name">佣金明细</span>
            <span class="iconfont iconxiangyou"></span>
        </a>
    </div>
    <quick-menu></quick-menu>
</div>
<script>
    require(['vue', 'helper', 'store', '{__WAP_PATH}zsff/js/quick.js'], function (Vue, $h, api) {
        new Vue({
            el: '#app',
            data: {
                top: 'auto',
                open: false,
                menuList: []
            },
            created: function() {
                // this.onReady();
            },
            methods: {
                onReady: function() {
                    var that = this;
                    api.baseGet($h.U({
                        c: 'auth_api',
                        a: 'suspensionButton'
                    }), function(res) {
                        var data = res.data.data;
                        that.menuList = data;
                    }, function(err) {
                        console.error(err.data.msg);
                    });
                },
                onMove: function(event) {
                    var clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
                        tithe = clientHeight / 10,
                        min = tithe * 2,
                        max = tithe * 8,
                        top = 0;
                    if (min >= event.touches[0].clientY) {
                        top = clientHeight / 10 * 2;
                    } else if (event.touches[0].clientY >= max) {
                        top = clientHeight / 10 * 8;
                    } else {
                        top = event.touches[0].clientY;
                    }
                    this.top = top + 'px';
                }
            }
        });
    });
</script>
{/block}
